import { NextResponse } from 'next/server';
import { initSocketIO } from '@/lib/socketio';
export function GET(req) {
  const { server } = req;
  if (!server.io) {
    console.log('*First use, starting socket.io');
    server.io = initSocketIO(server);
  } else {
    console.log('socket.io already running');
  }
  return NextResponse.json({ message: 'Socket.IO server running' });
}